<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>逻辑判断</title>
    <script>
      // if...else if...else
      let num = -1;
      if (10 < num && num <= 50) {
        console.log("Greater than 10 ");
      } else if (100 > num && num >= 50) {
        console.log("Greater than 50 ");
      } else {
        console.log("Losser");
      }

      // switch case
      let type = 1;
      switch (type) {
        case 1:
          console.log(1);
          break;
        case 2:
          console.log(2);
          break;
        default:
          console.log("switch default");
      }

      // 三元运算符
      type == 1 ? console.log("YES") : console.log("NO");
    </script>
  </head>
  <body></body>
</html>
